public class Ex8_1{
	public static void main(String[] args){
		Rectangle r1 = new Rectangle(4, 40);
		Rectangle r2 = new Rectangle(3.5, 35.9);
		System.out.printf("%.2f\t%.2f\t%.2f\t%.2f\n", 
			r1.width, r1.height, r1.getArea(), r1.getPerimeter());
		System.out.printf("%.2f\t%.2f\t%.2f\t%.2f\n", 
			r2.width, r2.height, r2.getArea(), r2.getPerimeter());
	}
}

class Rectangle{
	double width = 1;
	double height = 1;

	Rectangle(){
	}

	Rectangle(double w, double h){
		width = w;
		height = h;
	}

	double getArea(){
		return width * height;
	}

	double getPerimeter(){
		return 2 * (width + height);
	}
}